package com.seh.contentcenter.es;

import com.seh.contentcenter.dto.UserDTO;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import javax.persistence.Id;

@Data
@Document(indexName = "esgoods", createIndex = true)
public class ESGoods {
    //商品Id
    @Id
    @Field(type = FieldType.Text)
    private String id;
    //商品名称
    @Field(analyzer="ik_max_word")
    private String goodsName;
    //商家ID
    @Field(type = FieldType.Integer)
    private Integer userId;
    //商品描述
    @Field(type = FieldType.Text)
    private String goodsDesc;
    //商品类别
    @Field(analyzer="ik_max_word")
    private String goodsCategory;
    //商品价格
    @Field(type = FieldType.Double)
    private Double goodsPrice;
    //商品库存
    @Field(type = FieldType.Integer)
    private Integer goodsStock;
    //商品详情
    @Field(type = FieldType.Text)
    private String goodsDetail;
    //商品销量
    @Field(type = FieldType.Integer)
    private Integer goodsSalesVolume;
    //商品评价数
    @Field(type = FieldType.Integer)
    private Integer goodsEvaluation;
    //商品好评率
    @Field(type = FieldType.Double)
    private double goodsPraiseRate;
    //商品图片地址
    @Field(type = FieldType.Text)
    private String goodsPic;
    //商品地址
    @Field(type = FieldType.Text)
    private String addressName;
    //商品状态
    @Field(type = FieldType.Integer)
    private Integer goodsStatus;
//    //商家信息
//    @Field(type = FieldType.Object)
//    private UserDTO userDTO;
}
